package com.lovo.bbs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lovo.bbs.bean.Post;
import com.lovo.bbs.service.PostService;
import com.lovo.bbs.dao.PostMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author BDK-THINKPAD
* @description 针对表【t_post】的数据库操作Service实现
* @createDate 2023-07-17 10:56:23
*/
@Service
public class PostServiceImpl extends ServiceImpl<PostMapper, Post>
    implements PostService{


    @Override
    public PageInfo<Post> listPosts(int current, int pageSize) {
        PageHelper.startPage(current,pageSize);
        List<Post> posts = getBaseMapper().listPosts();
        return new PageInfo<>(posts);
    }
}




